package server.business.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import server.business.pojo.ReturnedBloodIn;
import server.business.service.ReturnedBloodInService;
import server.business.mapper.ReturnedBloodInMapper;
import org.springframework.stereotype.Service;

/**
* @author Galaxy
* @description 针对表【returned_blood_in(退血入库信息表)】的数据库操作Service实现
* @createDate 2022-11-08 12:46:24
*/
@Service("returnedBloodInService")
public class ReturnedBloodInServiceImpl extends ServiceImpl<ReturnedBloodInMapper, ReturnedBloodIn>
    implements ReturnedBloodInService{


    @Autowired
    private ReturnedBloodInMapper returnedBloodInMapper;

    /**
     * 向退血入库信息表中插入患者退血入库信息
     *
     * @param returnedBloodIn 退血入库信息包装类
     */
    @Override
    public void returnBloodIn(ReturnedBloodIn returnedBloodIn) {
        returnedBloodInMapper.insert(returnedBloodIn);
    }

    /**
     * 根据退血单号设置整体输血信息表中的是否允许退血字段
     *
     * @param number      退血单号
     * @param isAllowBack 是否允许退血
     */
    @Override
    public void setIsAllowBackByNumber(String number, Integer isAllowBack) {
        returnedBloodInMapper.setIsAllowBackByNumber(number, isAllowBack);
    }

    /**
     * 根据患者退血单号删除患者退血申请信息
     *
     * @param number 患者退血单号
     */
    @Override
    public void deleteBackInformationByNumber(String number) {
        returnedBloodInMapper.deleteBackInformationByNumber(number);
    }

    /**
     * 根据血站退血单号删除血站退血信息
     *
     * @param number 血站退血单号
     */
    @Override
    public void deleteBackInformationByStationNumber(String number) {
        returnedBloodInMapper.deleteBackInformationByStationNumber(number);
    }


}




